<!DOCTYPE HTML>
<html>

<head>
    <include file="Public/head" />
</head>

<body>
    <nav class="breadcrumb">
        <i class="Hui-iconfont">&#xe67f;</i> 首页
        <span class="c-gray en">&gt;</span>
        菜单管理
        <span class="c-gray en">&gt;</span>
        菜单列表
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);"
            title="刷新">
            <i class="Hui-iconfont">&#xe68f;</i>
        </a>
    </nav>
    <div class="page-container">
        <div>
            <table class="table table-border table-bordered table-hover table-bg table-sort">
                <thead>
                    <tr class="text-c">
                        <th width="80">ID</th>
                        <th width="80">排序</th>
                        <th>菜单名称</th>
                        <th>绑定模块</th>
                        <th>控制器</th>
                        <th>方法</th>
                        <th>是否显示</th>
                        <th>创建时间</th>
                        <th width="100">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <foreach name="list" item="vo">
                        <tr class="text-c">
                            <td>{$vo.id}</td>
                            <td>{$vo.sort}</td>
                            <td class="text-l">{$vo.name}</td>
                            <td>{$vo.model}</td>
                            <td>{$vo.controller}</td>
                            <td>{$vo.action}</td>
                            <td>{$vo.show}</td>
                            <td>{$vo.create_time}</td>
                            <td class="f-14">
                                <a title="编辑" href="{:U('Menu/edit',array('id'=>$vo['id']))}" style="text-decoration:none">
                                    <i class="Hui-iconfont">&#xe6df;</i>
                                </a>
                                <a title="删除" onclick="del_item({$vo['id']})" class="ml-5" style="text-decoration:none">
                                    <i class="Hui-iconfont">&#xe6e2;</i>

                                    <form method="POST" action="{:U('Menu/del')}" style="display: none;" id="del_from_{$vo['id']}">
                                        <input type="hidden" name="id" value="{$vo['id']}">
                                    </form>

                                </a>
                                <a title="下一级" href="{:U('Menu/lists',array('id'=>$vo['id']))}" class="ml-5" style="text-decoration:none">
                                    下一级
                                </a>
                            </td>
                        </tr>
                    </foreach>
                </tbody>
            </table>
        </div>
    </div>
    <include file="Public/script" />
</body>
<script>
    function del_item(id) {
        //询问框
        layer.confirm('确认要删除吗？', {
            btn: ['删除', '取消'] //按钮
        }, function () {
           $('#del_from_'+id).submit();
        }, function () {
            console.log('用户取消啦...');
        });
    }
</script>

</html>